<!DOCTYPE HTML>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<meta name="description" content="">
<title>微商城-商品信息</title>
<link type="text/css" rel="stylesheet" href="__PUBLIC__/Core/js/ext/toastr/toastr.min.css"/>
<link href="{:ADDON_PUBLIC_PATH}/../Template/default/style/myorder.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
<script type="text/javascript" src="__STATIC__/uctoo/js/jquery.js"></script>
<script type="text/javascript" src="{:ADDON_PUBLIC_PATH}/../Template/default/js/myorder.js"></script>
<script type="text/javascript" src="__STATIC__/uctoo/plugins/shop/js/mall.js"></script>
<script type="text/javascript" src="__STATIC__/uctoo/js/alloyimage.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Core/js/ext/toastr/toastr.min.js"></script>
    <script type="text/javascript" src="__PUBLIC__/Core/js/core.js"></script>

</head>

<body>
<php>

    //验证登录
    if(!is_login()){
    Cookie ( '__forward__', $_SERVER ['REQUEST_URI'] );
    }
</php>
 <BODY>
        <!--头部-->
        <HEADER class="ts1">
            <A class="u_back fl" href="javascript:history.go(-1)">
            </A>
            <UL class="topbar fr">
                <LI>
                    <A class="icon_user" href="{:U('myorder?ctid='.$ctid)}">
                        <I>
                        </I>
                        我的
                    </A>
                </LI>
                <LI>
                    <A class="icon_shopping" href="{:U('myshop?ctid='.$ctid)}">
                        <I>
                        </I>
                        购物车
                    </A>
                </LI>
                <LI>
                    <A class="icon_class" href="{:U('show?id='.$ctid)}">
                        <I>
                        </I>
                        菜单
                    </A>
                </LI>
                <LI>
                    <A class="icon_index" href="{:U('show?id='.$ctid)}">
                        <I>
                        </I>
                        主页
                    </A>
                </LI>
            </UL>
        </HEADER>
        <!--主体-->
        <DIV class="p_floatbox">
            <DIV class="f_list_car p_buy clearfix" id="p_buy">
                <SPAN class="all_price">
                    总价格：
                    <FONT id="all_price" price="{$sumprice}">
                        ￥{$sumprice}
                    </FONT>
                </SPAN>
                <SPAN>
                    总共
                    <FONT id="all_numb" count="{$sumcount}">
                        {$sumcount}
                    </FONT>
                    件商品
                </SPAN>
                <A class="p_btn_buy" href="{:U('myshop?ctid='.$ctid)}">
                    <SPAN class="ts1">
                        进入购物车
                    </SPAN>
                </A>
            </DIV>
        </DIV>
        <DIV class="main">
            <DIV class="banner" id="banner">
                <A href="javascript:;">
				<img id="mainimg" src="{$cpdata.path}" />
                    
                    <H1 class="p_title">
                        {$cpdata.name}
                    </H1>
                </A>
            </DIV>
            <DIV class="f_list_car p_buy clearfix">
                <SPAN class="all_price all_price_this">
                    价格：
                    <font id="cfg_price" price="{$cpdata.yhprice}">
                       ￥{$cpdata.yhprice}
                    </font>
                    <SPAN style="text-decoration: line-through;display: none" id="base_price" price="{$cpdata.price}">
                        原价： {$cpdata.price}元
                    </SPAN>
                </SPAN>
                <!--检查库存-->
                <A class="p_btn_buy" href="javascript:;">
                    <SPAN class="ts1" onclick="add_cart(1,parseFloat($('#cfg_price').attr('price')));">
                        加入购物车
                    </SPAN>
                </A>
            </DIV>
            <SCRIPT type="text/javascript">


                function add_cart(num,price) {
                <php>
                    $param ['ctid'] = $ctid;
                    $param ['cpid'] = $cpdata[id];
                    $Url = addons_url ( 'Mall://Mall/add_cart', $param );
                    $loginUrl = addons_url ( 'UserCenter://User/login' );
                </php>
                    var url = '{$Url}';
                    var loginUrl = '{$loginUrl}';

                    url=url.substring(0,url.indexOf(".html"));
                    var para = $('#cfg_price').data("param")+".html";
                    url=url.concat(para);
                    //var addurl = "/index.php?s=/addon/Mall/Mall/add_cart/ctid/{$ctid}/cpid/{$cpdata.id}.html";
                   //alert(url);
                    $.ajax({
                        url: url,
                        beforeSend: function( xhr ) {
                       //     var is_follow_login = {$is_follow_login};
                       //     if (is_follow_login != 2) {
                       //         a = {info:"请先登录再提交订单",url:loginUrl};
                       //         handleAjax(a);
                       //         return false;
                       //     }
                        },
                        success: function(data) {
                            if (data=="ok") {
                                var oldprice = parseFloat($('#p_buy #all_price').attr("price"));
								oldprice=oldprice+price;
								$('#p_buy #all_price').attr("price",oldprice);
								$('#p_buy #all_price').html('￥'+oldprice);
								var oldcount = parseInt($('#p_buy #all_numb').attr("count"));
								oldcount = oldcount+num;
								$('#p_buy #all_numb').attr("count",oldcount);
								$('#p_buy #all_numb').html(oldcount);
								$('#total_fee font').html('￥'+oldprice);
                            }
                        }
                    })
                }
            </SCRIPT>
            <DIV class="p_mod p_short_desc">
                <H2 class="p_mod_title">
                    商品属性
                </H2>
                <DIV class="p_con">
                                <div id="pro_attr_div_{$cpdata.id}" pro_id="{$cpdata.id}">
                <foreach name="attrs1" item="v">

                    <span style="float:left; line-height:24px;<eq name="v[0].is_show" value="0">display:none</eq>" >{$v[0].name}：</span>
                    <div name="{$v[0].name}" <eq name="v[0].is_show" value="0">style="display:none"</eq>>
                        <foreach name="v" item="vv">

                                <span class="pro_attr" title="{$vv.desc}" path="{$vv.path}" price="{$vv.price}"
                                      onclick="pro_attr_cfg(this,0)" onmouseover="pro_attr_mouseover(this)" onmouseout="pro_attr_mouseout(this)"
                            <switch name="v[0].pricetype">
                                <case value="0">baseprice="0"</case>
                                <case value="1">cfgprice="1"</case>
                            </switch>
                                      slt="0" attr_id="{$vv.id}">
                            <notempty name="vv.thumbnail">
                                <div class="sku">
                                    <img src="{$vv.thumbnail}" alt="{$vv.desc}">
                                </div>
                            </notempty>
                            {$vv.value}

                            </span>

                        </foreach>
                    </div>
                    <span style="display:block; clear:both; height:16px;<eq name="v[0].is_show" value="0">display:none</eq>"></span>
                </foreach>

<!--固定属性-->
                                    <foreach name="attrs2" item="v">

                                        <span style="float:left; line-height:24px;<eq name="v.is_show" value="0">display:none</eq>"   >{$v.name}：</span>
                                        <div id="{$v.name}" name="{$v.name}" <eq name="v.is_show" value="0">style="display:none"</eq> >
                                                <span class="pro_attr" title="{$v.desc}" path="{$v.path}" price="{$v.price}" value="{$v.value}"
                                                      onclick="pro_attr_cfg(this,0)"
                                        <switch name="v.pricetype">
                                            <case value="0">baseprice="0"</case>
                                            <case value="1">cfgprice="1"</case>
                                        </switch>
                                                      slt="0" attr_id="{$v.id}">
<notempty name="v.thumbnail">
    <div class="sku">
        <img src="{$v.thumbnail}" alt="{$v.desc}">
    </div>
</notempty>
                                                </span>
                                        </div>
                                        <span style="display:block; clear:both; height:16px;<eq name="v.is_show" value="0">display:none</eq>"></span>
                                    </foreach>
                                    <!--固定属性 end-->
            </div>
                </DIV>
            </DIV>
            <DIV class="p_mod p_short_desc">
                <H2 class="p_mod_title">
                    商品简介
                </H2>
                <DIV class="p_con">
                    <P>{$cpdata.introduction}</P>
                </DIV>

            </DIV>
            

            <SECTION class="f_list f_mod i_list">
                <H2 class="p_mod_title">
                    {$yhlists.name}
                </H2>
                <UL class="clearfix" id="f_list">
					 <volist name="yhlists.cpinfo" id="cp">
						<LI>
							<DIV class="f_list_l">
								<A href="/index.php/addon/Mall/Mall/cpinfo/ctid/{$ctid}/cpid/{$cp.id}.html">
									<IMG src="__ROOT__{$cp.icon|get_cover='path'}">
									<H3>
										{$cp.name}
									</H3>
									<P class="tui_price ts2" style="color: rgb(102, 102, 102); font-size: 14px; font-weight: normal; text-decoration: line-through;">
										原价：{$cp.price}&nbsp;元
									</P>
									<DIV class="hot">
										<STRONG style="display: none;">
											热卖
										</STRONG>
									</DIV>
								</A>
							</DIV>
							<DIV class="f_list_r">
								<P class="tui_price ts2">
									<STRONG>
										￥{$cp.price}
									</STRONG>
								</P>
								<A class="u_order_return ts1" id="in_car" href="/index.php/addon/Mall/Mall/cpinfo/ctid/{$ctid}/cpid/{$cp.id}.html">
									去购买
								</A>
							</DIV>
						</LI>  
					</volist>
                </UL>
            </SECTION>
            <BR>
         </DIV>
        <script type="text/javascript" src="__STATIC__/uctoo/plugins/shop/js/main.js"></script>
    </BODY>
</html>